-
Notifications
You must be signed in to change notification settings - Fork 47.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove false positive warning and add TODOs about current
being non-null
#14821
Conversation
|
Plain function:
Memo:
|
It seems like we use something else as an indicator whether we were suspended and should disconnect the alternate. For classes, we check the instance. For functions, we know we suspended because we're still Indeterminate. But for memo, we don't seem to use any indicator. |
Actually looks like classes have a special |
We should be able to remove this warning entirely, now that we have this invariant: react/packages/react-reconciler/src/ReactFiberHooks.js Lines 488 to 493 in f24a0da
I think I meant to do this in my PR but I must have forgotten. |
current
being non-null
Failing test for #14790.
Seems like we expect that alternate is always empty for Hook "mounts" but that's not the cause if a memo'd component has previously suspended.
Not sure what idiomatic fix is.